Link grammar (LG) is a theory of syntax by Davy Temperley and Daniel Sleator which builds relations between pairs of words, rather than constructing constituents in a tree-like hierarchy. There are two basic parameters: directionality and distance. Link grammar is similar to dependency grammar, but dependency grammar includes a head-dependent relationship, as well as lacking directionality in the relations between words. Colored Multiplanar Link Grammar (CMLG) is an extension of LG allowing crossing relations between pairs of words[1]
For example, in a subject–verb–object language like English, the verb would look left to form a subject link, and right to form an object link. Nouns would look right to complete the subject link, or left to complete the object link.
In a subject–object–verb language like Persian, the verb would look left to form an object link, and a more distant left to form a subject link. Nouns would look to the right for both subject and object links.
Contents |
Rightward links are represented as a +, and leftward links with a -. Optional links are contained in curly brackets {...}. Undesirable links are contained in any number of square brackets [...]. Multiple links are joined either by a conjunction & or a disjunction or. Each rule ends with a semicolon ;.
A basic rule file for an SVO language might look like:
Thus the English sentence, “The boy painted a picture” would appear as:
+-----O-----+ +-D-+--S--+ +--D--+ | | | | | The boy painted a picture
While a rule file for a null subject SOV language might consist of the following links:
And a simple Persian sentence, man nAn xordam (من نان خوردم) 'I ate bread' would look like:
+-----S-----+ | +--O--+ | | | man nAn xordam
The Link grammar syntax parser is a library for natural language processing written in C. It is available under the BSD license, which is compatible with the GNU General Public License. The parser is an ongoing project, located here. Recent versions include improved sentence coverage, various bug and security fixes, and Java language bindings.
There are also Perl, Python, Ruby, Java, OCaml and .NET bindings available.[2]
The link-grammar program along with rules and word lists for English may be found in standard Linux distributions, e.g., as a Debian package.[3]
AbiWord, a free word processor, uses Link Grammar for on-the-fly grammar checking.[1] Words that cannot be linked anywhere are underlined in green.
The RelEx semantic relationship extractor, layered on top of the Link Grammar library, generates a dependency grammar output by making explicit the semantic relationships between words in a sentence. Its output can be classified as being at a level between that of SSyntR and DSyntR of Meaning-Text Theory. It also provides framing/grounding, anaphora resolution, head-word identification, lexical chunking, part-of-speech identification, and tagging, including entity, date, money, gender, etc. tagging. It includes a compatibility mode to generate dependency output compatible with the Stanford parser, and Penn TreeBank-compatible POS tagging.
Link Grammar has also been employed for information extraction of biomedical texts[4][5] and events described in news articles,[6] as well as experimental machine translation systems from English to German and Turkish.
The Link Grammar link dictionary is used to generate and verify the syntactic correctness of two different natural language generation systems: NLGen[7] and NLGen2.[8] It is also used as a part of the NLP pipeline in the OpenCog AI project.